repopath <- fromRepo Git.repoPath
subdir <- liftIO $ relPathDirToFile repopath (literalOsPath ".")
let state = Remote.Compute.ComputeState
- -- TODO add inherited initremote parameters
- { Remote.Compute.computeParams = computeParams o
+ { Remote.Compute.computeParams = computeParams o ++
+ Remote.Compute.defaultComputeParams r
, Remote.Compute.computeInputs = mempty
, Remote.Compute.computeOutputs = mempty
, Remote.Compute.computeSubdir = subdir
getComputeProgram,
runComputeProgram,
ImmutableState(..),
+ defaultComputeParams,
) where
import Annex.Common
)
}
+defaultComputeParams :: Remote -> [String]
+defaultComputeParams = map mk . M.toList . getRemoteConfigPassedThrough . config
+ where
+ mk (f, v) = fromProposedAccepted f ++ '=' : v
+
newtype ComputeProgram = ComputeProgram String
deriving (Show)
git-annex addcomputed --to=y -- compress foo --level=9
git-annex addcomputed --to=z -- clip foo 2:01-3:00 combine with bar to baz
-
+Note that parameters that were passed to `git-annex initremote`
+when setting up the compute special remote will be appended to the end of
+the parameters provided to `git-annex addcomputed`.
# OPTIONS
[[git-annex-recompute]](1)
+[[git-annex-initremote]](1)
+
# AUTHOR
Joey Hess <id@joeyh.name>
this special remote uses a program to compute the contents of annexed
files.
+To add a file to a compute special remote, use the [[git-annex-addcomputed]]
+command. Once a file has been added to a compute special remote, commands
+like `git-annex get` will use it to compute the content of the file.
+
To enable an instance of this special remote:
# git-annex initremote myremote type=compute program=git-annex-compute-foo
"git-annex-compute-". The program needs to be installed somewhere in the
`PATH`.
-To add a file to a compute special remote, use the [[git-annex-addcomputed]]
-command. Once a file has been added to a compute special remote, commands
-like `git-annex get` will use it to compute the content of the file.
-
-You can provide other parameters to `initremote`, in order to provide
-default configuration values to use when adding files with
-[[git-annex-addcomputed]]. To see a list of all the configuration values
-supported by a given program, pass `--whatelse` to `initremote`:
+All other "field=value" parameters passed to `initremote` will be passed
+to the program when running [[git-annex-addcomputed]]. Note that when the
+program takes a dashed option, it can be provided after "--":
- # git-annex initremote myremote type=compute program=git-annex-compute-foo --whatelse
+ # git-annex initremote myremote type=compute program=git-annex-compute-foo -- --level=9
## compute programs